FROM python:3.6.8-slim 

LABEL MAINTAINER="faron"

WORKDIR /workplace

COPY supervisord.conf /etc/supervisor/supervisord.conf
RUN echo "Asia/Shanghai" > /etc/timezone; \ 
    mkdir /var/log/supervisor \
    && touch /var/log/supervisor/supervisord.log \
    && apt-get update && apt-get install -y cron autoconf automake libtool vim procps \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 

COPY docker-entrypoint.sh /
COPY requirements.txt ./
RUN mkdir /docker-entrypoint-initweb.d && \
    chmod a+x /docker-entrypoint.sh \
    && pip install -i https://mirrors.aliyun.com/pypi/simple --no-cache-dir -r requirements.txt \
    && rm -rf requirements.txt

ENTRYPOINT ["/docker-entrypoint.sh"]
